﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace JqueryNet.WinFormControl
{
    public class WinFormContentFactory
    {
        public virtual IJQueryForm CreateIJquery(Control _control)
        {
            switch (_control.GetType().FullName)
            {
                case "System.Windows.Forms.TextBox":
                    return new WTexxtBox(GetAsType<System.Windows.Forms.TextBox>(_control));
                default:
                    return new WControl(GetAsType<Control>(_control));
            }
        }

        protected T GetAsType<T>(Control _control) where T : Control
        {
            return (T)_control;
        }

    }
}
